#!/usr/bin/python

# myscrollwinevent.py

import wx

class MyScrollWinEvent(wx.Frame):
    def __init__(self, parent, id, title):
        wx.Frame.__init__(self, parent, id, title)
        panel = wx.Panel(self, -1)
        self.st = wx.StaticText(panel, -1, '0', (30,0))
        panel.Bind(wx.EVT_SCROLLWIN, self.OnScroll)
        panel.SetScrollbar(wx.VERTICAL, 0, 6, 50);
        self.Centre()

    def OnScroll(self, evt):
        y = evt.GetPosition()
        self.st.SetLabel(str(y))

class MyApp(wx.App):
    def OnInit(self):
        msw = MyScrollWinEvent(None, -1, 'myscrollwinevent.py')
        msw.Show(True)
        return True

app = MyApp(0)
app.MainLoop()

